#include "dominion.h"
#include "dominion_helpers.h"
#include <string.h>
#include <stdio.h>
#include <assert.h>
#include "rngs.h"

#define NOISY_TEST 1

void checkMine(struct gameState *pre) {
  struct gameState post;
  int test;
  memcpy (&post, pre, sizeof(struct gameState));
  printf("Player attempts to play mine with an estate\n");
  post.hand[0][0] = estate;
  test = mine_card(0, &post, 0, 0, gold);
  assert(test == -1);
  printf("Player attempts to play mine with a card out of range\n");
  post.hand[0][0] = copper;
  test = mine_card(0, &post, 0, 0, 34);
  assert(test == -1);
  printf("Player attempts to play mine for copper to gold\n");
  post.hand[0][0] = copper;
  test = mine_card(0, &post, 0, 0, gold);
  assert(test == -1);
  printf("Player attempts to play mine for copper to silver\n");
  post.hand[0][0] = copper;
  test = mine_card(0, &post, 0, 0, silver);
  assert(test == 0);
}

int main () {
  int k[10] = {adventurer, council_room, feast, gardens, mine,
	       remodel, smithy, village, baron, great_hall};
  struct gameState G;
  printf ("FIXED TESTING mine.\n");
  initializeGame(4, k, 1, &G);
  checkMine(&G);
  printf ("ALL TESTS OK\n");
  return 0;
}
